﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="mail.aspx.cs" Inherits="mail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="MAIL_ID" 
            DataSourceID="ObjectDataSource1" DefaultMode="Insert">
            <EditItemTemplate>
                MAIL_ID:
                <asp:Label ID="MAIL_IDLabel1" runat="server" Text='<%# Eval("MAIL_ID") %>' />
                <br />
                Name:
                <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
                <br />
                Mail:
                <asp:TextBox ID="MailTextBox" runat="server" Text='<%# Bind("Mail") %>' />
                <br />
                Emne:
                <asp:TextBox ID="EmneTextBox" runat="server" Text='<%# Bind("Emne") %>' />
                <br />
                Text:
                <asp:TextBox ID="TextTextBox" runat="server" Text='<%# Bind("Text") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                Name:
                <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' />
                <br />
                Mail:
                <asp:TextBox ID="txtMail" runat="server" Text='<%# Bind("Mail") %>' />
                <br />
                Emne:
                <asp:TextBox ID="txtEmne" runat="server" Text='<%# Bind("Emne") %>' />
                <br />
                Text:
                <asp:TextBox ID="txtText" runat="server" " Text='<%# Bind("Text") %>' TextMode="MultiLine" />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" onclick="InsertButton_Click" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" Visible="False" />
            </InsertItemTemplate>
            <ItemTemplate>
                MAIL_ID:
                <asp:Label ID="MAIL_IDLabel" runat="server" Text='<%# Eval("MAIL_ID") %>' />
                <br />
                Name:
                <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />
                <br />
                Mail:
                <asp:Label ID="MailLabel" runat="server" Text='<%# Bind("Mail") %>' />
                <br />
                Emne:
                <asp:Label ID="EmneLabel" runat="server" Text='<%# Bind("Emne") %>' />
                <br />
                Text:
                <asp:Label ID="TextLabel" runat="server" Text='<%# Bind("Text") %>' />
                <br />
                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                    CommandName="New" Text="New" />
                &nbsp;
            </ItemTemplate>
        </asp:FormView>
<asp:Label ID="lblError" runat="server"></asp:Label>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="GetData" TypeName="DataSet1TableAdapters.USA_MailTableAdapter">
            <InsertParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Mail" Type="String" />
                <asp:Parameter Name="Emne" Type="String" />
                <asp:Parameter Name="Text" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
